#pragma once
#include <vector>
#include <string>
#include <iostream>

#include "Mesh.h"

#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

unsigned int TextureFromFile(const char *path, const std::string &directory, bool gamma = false);

class Model
{
public:
	Model(std::string &path);
	~Model();
	void Draw(Shader* shader);

private:
	void loadModel(std::string &path);
	void processNode(aiNode* node, const aiScene* scene);
	Mesh processMesh(aiMesh* mesh, const aiScene* scene);

	std::vector<Texture> loadMaterialTextures(aiMaterial* material, aiTextureType type, std::string typeName);
public:
	std::vector<Mesh> meshs;
	std::string directory;
	std::vector<Texture> textures_loaded; // stores all the textures loaded so far
};

